<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('钱宝对账文件列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 100px;">商户编号：</label>
                                <input type="text" name="merNo"/>
                            </li>
                            <li>
                                <label style="width: 100px;">商户名称：</label>
                                <input type="text" name="merName"/>
                            </li>
                            <li>
                                <label style="width: 100px;">卡组织：</label>
                                <select name="cardOrg">
                                    <option value="">所有</option>
                                    <option value="1">银联</option>
                                    <option value="2">银联国际</option>
                                    <option value="3">JCB</option>
                                    <option value="4">VISA</option>
                                    <option value="5">MASTER</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 100px;">卡类型：</label>
                                <select name="cardType">
                                    <option value="">所有</option>
                                    <option value="00">借记卡</option>
                                    <option value="01">贷记卡</option>
                                    <option value="02">准贷记卡</option>
                                    <option value="03">预付费卡</option>
                                    <option value="05">未知卡</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 100px;">终端编号：</label>
                                <input type="text" name="termId"/>
                            </li>
                            <li>
                                <label style="width: 100px;">原交易批次号：</label>
                                <input type="text" name="oriBatno"/>
                            </li>
                            <li>
                                <label style="width: 100px;">原交易流水号：</label>
                                <input type="text" name="oriSys"/>
                            </li>

                            <li>
                                <label style="width: 100px;">钱宝流水号：</label>
                                <input type="text" name="terminalSerial"/>
                            </li>
                            <li class="select-time">
                                <label style="width: 100px;">交易日期：</label>
                                <input type="text" class="time-input" readonly placeholder="开始时间" name="start"/>
                                <span>-</span>
                                <input type="text" class="time-input" readonly placeholder="结束时间" name="end"/>
                            </li>
                            <li>
                                <label style="width: 10px;"></label>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
               <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="qbMerWithdrawal:qbMerWithdrawal:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="qbMerWithdrawal:qbMerWithdrawal:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="qbMerWithdrawal:qbMerWithdrawal:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="qbMerWithdrawal:qbMerWithdrawal:export">
                    <i class="fa fa-download"></i> 导出
                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('qbMerWithdrawal:qbMerWithdrawal:edit')}]];
        var removeFlag = [[${@permission.hasPermi('qbMerWithdrawal:qbMerWithdrawal:remove')}]];
        var prefix = ctx + "qbMerWithdrawal/qbMerWithdrawal";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "钱宝对账文件",
                firstLoad:false,
                clickToSelect:true,
                columns: [{
                    checkbox: true
                },
                {
                    field: 'merNo',
                    title: '商户编号',
                    align: 'center'
                },
                {
                    field: 'merName',
                    title: '商户名称',
                    align: 'center'
                },
                {
                    field: 'msgType',
                    title: '交易类型',
                    align: 'center',
                    formatter:function(value,row,index){
                        if (value == '1761'){
                            return "WAP最优惠消费";
                        } else if (value == '1801'){
                            return "WAP好优选消费";
                        } else if (value == '1821'){
                            return "WAP全积分消费";
                        } else if (value == '1411'){
                            return "银联二维码被扫";
                        } else if (value == '1611'){
                            return "银联二维码主扫";
                        } else if (value == '3091'){
                            return "预授权完成撤销";
                        } else if (value == '1091'){
                            return "预授权完成";
                        } else if (value == '1621'){
                            return "支付宝主扫";
                        } else if (value == '1861'){
                            return "银联在线";
                        } else if (value == '1211'){
                            return "主动提现";
                        } else if (value == '1221'){
                            return "自动提现";
                        } else if (value == '1311'){
                            return "满额提现";
                        } else if (value == '1431'){
                            return "微信被扫";
                        } else if (value == '1941'){
                            return "云闪付";
                        } else if (value == '1841'){
                            return "手机pay";
                        } else if (value == '1101'){
                            return "消费";
                        } else if (value == '5151'){
                            return "退货";
                        } else if (value == '1421'){
                            return "支付宝被扫";
                        } else if (value == '1631'){
                            return "微信主扫";
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'tradStatus',
                    title: '交易应答码',
                    align: 'center'
                },
                {
                    field: 'amount',
                    title: '交易金额',
                    align: 'center'
                },
                {
                    field: 'charge',
                    title: '交易手续费',
                    align: 'center'
                },
                {
                    field: 'cardNum',
                    title: '交易卡号',
                    align: 'center'
                },
                {
                    field: 'cardOrg',
                    title: '卡组织',
                    formatter:function(value,row,index){
                        if (value == '1'){
                            return "银联";
                        } else if (value == '2'){
                            return "银联国际";
                        } else if (value == '3'){
                            return "JCB";
                        } else if (value == '4'){
                            return "VISA";
                        } else if (value == '5'){
                            return "MASTER";
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'cardType',
                    title: '卡类型',
                    formatter:function(value,row,index){
                        if (value == '00'){
                            return "借记卡";
                        } else if (value == '01'){
                            return "贷记卡";
                        } else if (value == '02'){
                            return "准贷记卡";
                        } else if (value == '03'){
                            return "预付费卡";
                        } else if (value == '05'){
                            return "未知卡";
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'cardBin',
                    title: '发卡行',
                    align: 'center'
                },
                {
                    field: 'termId',
                    title: '终端编号',
                    align: 'center'
                },
                {
                    field: 'oriBatno',
                    title: '原交易批次号',
                    align: 'center'
                },
                {
                    field: 'oriSys',
                    title: '原交易流水号',
                    align: 'center'
                },
                {
                    field: 'localdatetime',
                    title: '交易时间',
                    align: 'center'
                },
                {
                    field: 'terminalSerial',
                    title: '钱宝流水号',
                    align: 'center'
                },
                /*{
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.msgType + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.msgType + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }*/]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>